package jlibrarian.entities;

import java.util.Calendar;

/**
 * Created by IntelliJ IDEA.
 * User: MantaEx
 * Date: 23.2.11
 * Time: 18:43
 * To change this template use File | Settings | File Templates.
 */
public class Customer
{
    private int cid;
    private String firstName;
    private String surname;
    private Calendar born;
    private String city;
    private String street;

    private String telephone;

    public Customer()
    {
    }

    public Customer(int cid, String firstName, String surname, Calendar born, String city, String street, String telephone) {
        this.cid = cid;
        this.firstName = firstName;
        this.surname = surname;
        this.born = born;
        this.city = city;
        this.street = street;
        this.telephone = telephone;
    }

    public Calendar getBorn() {
        return born;
    }

    public int getCid() {
        return cid;
    }

    public String getCity() {
        return city;
    }

    public String getFirstName() {
        return firstName;
    }

    public String getStreet() {
        return street;
    }

    public String getSurname() {
        return surname;
    }

    public String getTelephone() {
        return telephone;
    }

    public void setBorn(Calendar born) {
        this.born = born;
    }

    public void setCid(int cid) {
        this.cid = cid;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    public void setStreet(String street) {
        this.street = street;
    }

    public void setSurname(String surname) {
        this.surname = surname;
    }

    public void setTelephone(String telephone) {
        this.telephone = telephone;
    }
    
    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (!(obj instanceof Customer)) {
            return false;
        }
        
        final Customer other = (Customer) obj;
        if (this.cid != other.cid) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 5;
        hash = 83 * hash + this.cid;
        return hash;
    }
    
    @Override
    public String toString()
    {
        return this.getSurname() + ", " + this.getFirstName();
    }
 
}
